package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.DateUtil;
import cn.wolfcode.trip.base.util.JSONUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import java.util.*;

@Setter
@Getter
@JsonIgnoreProperties("handler")//装json对象的时候忽略 handler 属性
public class Comment extends BaseDomain{
    public static final int TYPE_STRATEGY = 1;//攻略
    public static final int TYPE_TRAVEL = 2;//游记
    public static final int TYPE_NEWS = 3;//日报
    public static final int TYPE_TOGETHER = 4;//结伴
    public static final int TYPE_Dynamic =5;//朋友圈

    private User commenter;//评论者

    private Integer type=TYPE_Dynamic;//文章类型

    private Long answer_id;//文章的id

    private String content; //评论内容

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createtime; //评论时间


    private List<Reply> commentOfAlls = new ArrayList<>();//所有的回复


    /*public String getJson(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("createtime", DateUtil.formatDate(createtime));

        return JSONUtil.toJSONString(map);
    }*/

}